import os
import cv2
import numpy as np
import torch
from .FashionMNIST import transform_default
from .FashionMNIST import FashionMNISTTrainDataset, FashionMNISTTestDataset
from ..visualization import cv_show_image_single


def unittest_01(dataset_folder):
    print("FunctionTest: testing train dataset definition of FashionMNIST..")
    dataset_folder = os.path.join(dataset_folder)
    dataset = FashionMNISTTrainDataset(dataset_folder, transform=None, resize_shape=(600,600))
    batch_size = 5050
    train_loader = torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=True)
    for X, y in train_loader:
        print(X.shape, y.shape)
    cv_show_image_single(X[0])


def unittest_02(dataset_folder):
    print("FunctionTest: testing test dataset definition of FashionMNIST..")
    dataset_folder = os.path.join(dataset_folder)
    dataset = FashionMNISTTestDataset(dataset_folder, resize_shape=(600, 600))
    batch_size = 1010
    train_loader = torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=True)
    for X, y in train_loader:
        print(X.shape, y.shape)
    cv_show_image_single(X[0])
